<script type="text/javascript" src="/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
function FCKeditor_OnComplete(editorInstance){
  editorInstance.Events.AttachEvent('OnBlur', FCKeditor_OnBlur) ;
  editorInstance.Events.AttachEvent('OnFocus', FCKeditor_OnFocus) ;
}

function FCKeditor_OnBlur(editorInstance){
  editorInstance.ToolbarSet.Collapse();
}

function FCKeditor_OnFocus(editorInstance){
  editorInstance.ToolbarSet.Expand();
}

function onSave(form) {
  var d = FCKeditorAPI.GetInstance('description');
  var t = FCKeditorAPI.GetInstance('text');
  form.elements['description'].value = d.GetXHTML(true);
  form.elements['text'].value = t.GetXHTML(true);
  return true;
}
</script>
<form action="<?php echo $_SERVER['REDIRECT_URL']?>" method="post" onmouseover="this.elements['blog'].value = 1">
<input type="hidden" name="article" value="<?php echo $snippetId ?>" />
<input type="hidden" name="docId" value="<?php echo $docId ?>" />
<input type="hidden" name="blog" value="0" />
<input type="hidden" name="action" value="edit" />
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tbody valign="top">
<tr>
  <td width="10%">Заголовок</td>
  <td width="90%"><input type="text" name="subj" value="<?php echo htmlspecialchars($data['subj'], ENT_QUOTES) ?>" size="60" style="width: 98%" /></td>
</tr>
<tr>
  <td>Аннотация</td>
  <td><textarea name="description" rows="10" cols="60"><?php echo htmlspecialchars($data['description'], ENT_QUOTES) ?></textarea></td>
</tr>
<tr>
  <td>Заметка</td>
  <td><textarea name="text" rows="10" cols="60"><?php echo htmlspecialchars($data['text'], ENT_QUOTES) ?></textarea></td>
</tr>
<tr>
  <td>Комментарии</td>
  <td><input type="checkbox" name="comments" id="comments-switcher" value="1"<?php if($data['comments'] == 1) echo " checked"?> /> <label for="comments-switcher">включить</label></td>
</tr>
<tr>
  <td></td>
  <td><input type="submit" value="Сохранить"/></td>
</tr>
</tbody>
</table>
<script type="text/javascript">
window.fields = {};
if(window.FCKeditor){
  window.fields['description'] = new FCKeditor('description', '100%', '400', 'Editor');
  window.fields['description'].Config.ToolbarStartExpanded = false;
  window.fields['description'].ReplaceTextarea();

  window.fields['text'] = new FCKeditor('text', '100%', '600', 'Editor');
  window.fields['text'].Config.ToolbarStartExpanded = false;
  window.fields['text'].ReplaceTextarea();
}
</script>
</form>